This invention relates to a storage device equipped with a storage medium, a method of controlling the device, a storage system and a method of controlling the storage system.
In a magnetic storage device accommodating a storage medium such as a hard disk, it is usual for the storage medium to have defective storage areas that do not implement the storage function. To deal with a storage area having such a defect, substitution processing is executed. In substitution processing, a substitute storage area is prepared and is substituted for the defective storage area. In addition to substitution processing set when the product is shipped, substitution processing can be performed also with regard to defects that occur afresh during use of the device.
Substitution processing according to the prior art will be described with reference to FIG. 7.
Shown in FIG. 7 are a storage device 71 having ordinary storage areas 72 and substitute storage areas 73 set aside in order that substitution processing may be executed if some of the ordinary storage areas 72 develop defects. Shown at 74 is a substitute-area management area (referred to as a "defect list" or the like) for storing information indicating which areas have defects and which of the substitute storage areas 73 have been substituted for them.
Defective areas are of two types, namely a defective area 75 which existed from the outset at shipping of the storage device 71 from the factory, and a defective area 76 which developed subsequently during use of the device. When each of these areas is subjected to substitution processing, the defective area is replaced by a substitute storage area and information relating to the substitution is stored in the substitute-area management area 74.
By way of example, Japanese Patent Application Laid-Open (Kokai) No. 4-266117 describes a storage device in which the storage areas of the storage device are monitored to determine, at reading or writing of data, the number of reading/writing retries and occurrence of errors per each storage area. By recording the number of read/write retries associated with each storage area of the storage device, storage areas deemed to be likely to fail or storage areas in which defects have occurred during use can be replaced by substitute storage areas automatically.
However, with the conventional storage device of this kind, substitution processing for dealing with defects that have occurred anew during use of the device is executed in response to an instruction from the user.
Further, as described in Japanese Patent Application Laid-Open No. 4-266117, the detection and prediction of the occurrence of defects is limited to storage areas actually accessed. More specifically, the detection and prediction of defects in storage areas is not carried out with regard to storage areas currently vacant and unused but to which data are likely to be written in the future or with regard to storage areas in which data exist but which will not be read or written for an extended period of time.
Another problem is that satisfactory detection and prediction of the occurrence of defects cannot be carried out because such detection and prediction is performed only when a read instruction or write instruction is implemented as an actual accessing operation.